<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="root">
      <p @click="add">{{refData.count}}</p>
      <p @click="changeName">{{refData.name}}</p>
    </div>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/vue/3.0.0/vue.global.js"></script>
    <script>
      function changeName({ value: data }) {
        console.log(123);
        return data.name === "wxs" ? "imycode" : "null";
      }

      let { ref, toRefs } = Vue;
      let rootConf = {
        setup() {
          let refData = ref({ count: 0, name: "wxs" });
          let add = () => {
            refData.value.count++;
          };

          return {
            refData,
            add,
            changeName(refData)
          };
        },
      };
      Vue.createApp(rootConf).mount("#root");
    </script>
  </body>
</html>
